<template>
  <div>
    <div class="header">
      <div style="display: flex">
        <van-icon
          @click="handleBack"
          size="23"
          class="left-icon"
          name="arrow-left"
        />
        <div class="left-icon">账号管理</div>
      </div>
    </div>
    <van-cell-group>
      <van-cell
        border="true"
        title="编辑资料"
        is-link
        :to="'/me/details/' + user.id"
      />
      <van-cell border="true" title="修改密码" is-link :to="'/me/changepw/'" />
      <van-button type="danger" block plain :to="'/login'" style="border: none"
        >退出登录</van-button
      >
    </van-cell-group>
  </div>
</template>

<script>
export default {
  data() {
    return {
      user: JSON.parse(localStorage.getItem("user")),
    };
  },
  methods: {
    handleBack() {
      this.$router.back();
    },
  },
};
</script>
<style scoped>
.header {
  width: 100%;
  height: 70px;
  background: #ffffff;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
.left-icon {
  padding-top: 23px;
  padding-left: 15px;
  margin-right: 20px;
}
</style>